package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.DepartmentsEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DepartmentsMapper extends BaseMapper<DepartmentsEntity> {
    List<DepartmentsEntity> pageList(@Param("offset") int offset,@Param("pageSize") int pageSize);

    int pageListCount(@Param("offset") int offset,@Param("pageSize") int pageSize);

    @Insert("INSERT INTO hand_departments (department_id, department_code, department_name, manager_id, location_id) " +
            "VALUES (#{departmentId}, #{departmentCode}, #{departmentName}, #{managerId}, #{locationId})")
    int insertDepartment(DepartmentsEntity departmentsEntity);
}
